var _class, _temp;

import { Provider as TCRNProvider } from '@tarojs/components-rn';
import TaroRouter from '@tarojs/taro-router-rn';
import pagesNewestPersonnelDetail from './pages/newest/personnel_detail';
import pagesNewestPositionDetail from './pages/newest/position_detail';
import pagesNewestServiceDetail from './pages/newest/service_detail';
import pagesNewestDemandDetail from './pages/newest/demand_detail';
import pagesNewestPersonnelCenter from './pages/newest/personnel_center';
import pagesNewestIndex from './pages/newest/index';
import pagesOtherRegistAgreement from './pages/other/regist_agreement';
import pagesOtherReportSuccess from './pages/other/report_success';
import pagesOtherSubmitSuccess from './pages/other/submit_success';
import pagesOtherReportDetail from './pages/other/report_detail';
import pagesLoginQrCode from './pages/login/qr_code';
import pagesLoginForgetPassword from './pages/login/forget_password';
import pagesLoginRegisterStepTwo from './pages/login/register_step_two';
import pagesLoginRegisterStepOne from './pages/login/register_step_one';
import pagesLoginLogin from './pages/login/login';
import pagesMallAddress from './pages/mall/address';
import pagesMallOrderConfirmCustom from './pages/mall/order_confirm_custom';
import pagesMallCustomDetail from './pages/mall/custom_detail';
import pagesMallCustomList from './pages/mall/custom_list';
import pagesMallCustom from './pages/mall/custom';
import pagesMallPaySuccess from './pages/mall/pay_success';
import pagesMallOrderConfirm from './pages/mall/order_confirm';
import pagesMallDetail from './pages/mall/detail';
import pagesMallIndex from './pages/mall/index';
import pagesAllServicesLife from './pages/all_services/life';
import pagesAllServicesNone from './pages/all_services/none';
import pagesAllServicesIndex from './pages/all_services/index';
import pagesTenderingIndex from './pages/tendering/index';
import pagesBusinessSchoolOther from './pages/business_school/other';
import pagesBusinessSchoolArchitect from './pages/business_school/architect';
import pagesBusinessSchoolBuildCompany from './pages/business_school/build_company';
import pagesBusinessSchoolDetail from './pages/business_school/detail';
import pagesBusinessSchoolCourseList from './pages/business_school/course_list';
import pagesBusinessSchoolIndex from './pages/business_school/index';
import pagesUserCompanyAddress from './pages/user/company_address';
import pagesUserIssue from './pages/user/issue';
import pagesUserCollection from './pages/user/collection';
import pagesUserCompanyAuth from './pages/user/company_auth';
import pagesUserAbout from './pages/user/about';
import pagesUserSetPasswordPhone from './pages/user/set_password_phone';
import pagesUserSetPassword from './pages/user/set_password';
import pagesUserSetPhone from './pages/user/set_phone';
import pagesUserSetting from './pages/user/setting';
import pagesUserOrderPaySuccess from './pages/user/order_pay_success';
import pagesUserOrderDetail from './pages/user/order_detail';
import pagesUserUserInfoEdit from './pages/user/user_info_edit';
import pagesUserOrder from './pages/user/order';
import pagesUserCourseDetail from './pages/user/course_detail';
import pagesUserCourse from './pages/user/course';
import pagesUserHelpDetail from './pages/user/help_detail';
import pagesUserHelp from './pages/user/help';
import pagesUserAddressEdit from './pages/user/address_edit';
import pagesUserAddressAdd from './pages/user/address_add';
import pagesUserAddress from './pages/user/address';
import pagesUserBankCardAdd from './pages/user/bank_card_add';
import pagesUserBankCard from './pages/user/bank_card';
import pagesUserQrcode from './pages/user/qrcode';
import pagesUserBuyLog from './pages/user/buy_log';
import pagesUserUpgradePaySuccess from './pages/user/upgrade_pay_success';
import pagesUserUpgrade from './pages/user/upgrade';
import pagesUserApplyLog from './pages/user/apply_log';
import pagesUserIntegral from './pages/user/integral';
import pagesUserTeamMember from './pages/user/team_member';
import pagesUserTeam from './pages/user/team';
import pagesUserSign from './pages/user/sign';
import pagesUserCashSuccess from './pages/user/cash_success';
import pagesUserCashNow from './pages/user/cash_now';
import pagesUserMyProfitCashNone from './pages/user/my_profit_cash_none';
import pagesUserMyProfitList from './pages/user/my_profit_list';
import pagesUserMyProfit from './pages/user/my_profit';
import pagesUserIndex from './pages/user/index';
import pagesPublicWelfareWelfareRecordDetail from './pages/public_welfare/welfare_record_detail';
import pagesPublicWelfareWelfareRecord from './pages/public_welfare/welfare_record';
import pagesPublicWelfareWelfareSuccess from './pages/public_welfare/welfare_success';
import pagesPublicWelfareWelfareApply from './pages/public_welfare/welfare_apply';
import pagesPublicWelfareWelfareDetail from './pages/public_welfare/welfare_detail';
import pagesPublicWelfareWelfare from './pages/public_welfare/welfare';
import pagesPublicWelfareActivityDetail from './pages/public_welfare/activity_detail';
import pagesPublicWelfareActivity from './pages/public_welfare/activity';
import pagesPublicWelfareIndex from './pages/public_welfare/index';
import pagesDynamicDetail from './pages/dynamic/detail';
import pagesDynamicIndex from './pages/dynamic/index';
import pagesCompanyCreditPage2 from './pages/company_credit/page2';
import pagesCompanyCreditPage1 from './pages/company_credit/page1';
import pagesCompanyCreditIndex from './pages/company_credit/index';
import pagesLibraryIndex from './pages/library/index';
import pagesBusinessPage4Highway from './pages/business/page4_highway';
import pagesBusinessPage4Credit from './pages/business/page4_credit';
import pagesBusinessPage4Water from './pages/business/page4_water';
import pagesBusinessPage4 from './pages/business/page4';
import pagesBusinessPage3Demand from './pages/business/page3_demand';
import pagesBusinessPage3Detail from './pages/business/page3_detail';
import pagesBusinessPage3 from './pages/business/page3';
import pagesBusinessPage2Cancel from './pages/business/page2_cancel';
import pagesBusinessPage2Inspection from './pages/business/page2_inspection';
import pagesBusinessPage2Declare from './pages/business/page2_declare';
import pagesBusinessPage2 from './pages/business/page2';
import pagesBusinessBusinessSuccess from './pages/business/business_success';
import pagesBusinessPage1 from './pages/business/page1';
import pagesBusinessIndex from './pages/business/index';
import pagesFinanceFinanceQuery from './pages/finance/financeQuery';
import pagesFinancePage4Detail from './pages/finance/page4_detail';
import pagesFinancePage4Demand from './pages/finance/page4_demand';
import pagesFinancePage4 from './pages/finance/page4';
import pagesFinancePage3 from './pages/finance/page3';
import pagesFinancePage2 from './pages/finance/page2';
import pagesFinanceFinanceSuccess from './pages/finance/finance_success';
import pagesFinancePage1StepThree from './pages/finance/page1_step_three';
import pagesFinancePage1StepTwo from './pages/finance/page1_step_two';
import pagesFinancePage1 from './pages/finance/page1';
import pagesFinanceIndex from './pages/finance/index';
import pagesLegalDetail from './pages/legal/detail';
import pagesLegalIndex from './pages/legal/index';
import pagesIndexRresume from './pages/index/rresume';
import pagesIndexPosition from './pages/index/position';
import pagesIndexServices from './pages/index/services';
import pagesIndexDemand from './pages/index/demand';
import pagesIndexNoticeDetail from './pages/index/notice_detail';
import pagesIndexIndex from './pages/index/index';
import Taro from '@tarojs/taro-rn';
import '@tarojs/async-await';
import React from 'react';
import { Component } from "@tarojs/taro-rn";
import { Provider } from "@tarojs/mobx-rn";

import { getRuntime, ServerHost } from "./utils/common";
// import counterStore from './store/counter'
import Stores from "./store/Stores";
import appStyleSheet from "./app_styles";
var _styleSheet = appStyleSheet;
// 引入组件样式
// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释：
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5')  {
//   require('nerv-devtools')
// }
const store = {
  stores: new Stores()
};
let App = (_temp = _class = class App extends Component {
  constructor() {
    super(...arguments);
    Taro._$app = this;
  }
  componentDidMount() {
    // 当用户通过分享二维码进来时，用户授权之后的毁掉地址是首页
    Taro.setNavigationBarTitle({ title: '建务通' });
    // console.log(getRuntime().getUserInfo())
    let url = window.location.href;
    let code = '';
    if (url.includes('code')) {
      code = window.location.href.split('=')[1];
    }
    // 获取用户信息, 判断用户是否关注公众号
    let user = getRuntime().getUserInfo();
    let token = user && user.token ? 'Bearer ' + user.token : '';
    if (code && getRuntime().getToken()) {
      let fetchUrl = ServerHost + '/api/Account/getWchatUserInfo?code=' + code;
      fetch(fetchUrl, {
        method: 'GET',
        headers: {
          'Authorization': token
        }
      }).then(response => {
        return response.json();
      }).then(res => {
        if (res.subscribe === '0') {
          // 未关注
          getRuntime().redirectTo('/pages/login/qr_code');
          return;
        }
      }).catch(e => {
        console.error(e);
      });
    }
  }
  componentDidCatchError() {}
  render() {
    return <Provider store={store}>
                  
                <TCRNProvider>
                  <RootStack />
                </TCRNProvider>
                </Provider>;
  }
}, _class.config = {
  window: {
    backgroundTextStyle: "light",
    navigationBarBackgroundColor: "#ffffff",
    navigationBarTitleText: "建务通",
    navigationBarTextStyle: "black",
    backgroundColor: '#ffffff',
    onReachBottomDistance: 10
  }
}, _temp);
const RootStack = TaroRouter.initRouter([['pages/index/index', pagesIndexIndex], ['pages/index/notice_detail', pagesIndexNoticeDetail], ['pages/index/demand', pagesIndexDemand], ['pages/index/services', pagesIndexServices], ['pages/index/position', pagesIndexPosition], ['pages/index/rresume', pagesIndexRresume], ['pages/legal/index', pagesLegalIndex], ['pages/legal/detail', pagesLegalDetail], ['pages/finance/index', pagesFinanceIndex], ['pages/finance/page1', pagesFinancePage1], ['pages/finance/page1_step_two', pagesFinancePage1StepTwo], ['pages/finance/page1_step_three', pagesFinancePage1StepThree], ['pages/finance/finance_success', pagesFinanceFinanceSuccess], ['pages/finance/page2', pagesFinancePage2], ['pages/finance/page3', pagesFinancePage3], ['pages/finance/page4', pagesFinancePage4], ['pages/finance/page4_demand', pagesFinancePage4Demand], ['pages/finance/page4_detail', pagesFinancePage4Detail], ['pages/finance/financeQuery', pagesFinanceFinanceQuery], ['pages/business/index', pagesBusinessIndex], ['pages/business/page1', pagesBusinessPage1], ['pages/business/business_success', pagesBusinessBusinessSuccess], ['pages/business/page2', pagesBusinessPage2], ['pages/business/page2_declare', pagesBusinessPage2Declare], ['pages/business/page2_inspection', pagesBusinessPage2Inspection], ['pages/business/page2_cancel', pagesBusinessPage2Cancel], ['pages/business/page3', pagesBusinessPage3], ['pages/business/page3_detail', pagesBusinessPage3Detail], ['pages/business/page3_demand', pagesBusinessPage3Demand], ['pages/business/page4', pagesBusinessPage4], ['pages/business/page4_water', pagesBusinessPage4Water], ['pages/business/page4_credit', pagesBusinessPage4Credit], ['pages/business/page4_highway', pagesBusinessPage4Highway], ['pages/library/index', pagesLibraryIndex], ['pages/company_credit/index', pagesCompanyCreditIndex], ['pages/company_credit/page1', pagesCompanyCreditPage1], ['pages/company_credit/page2', pagesCompanyCreditPage2], ['pages/dynamic/index', pagesDynamicIndex], ['pages/dynamic/detail', pagesDynamicDetail], ['pages/public_welfare/index', pagesPublicWelfareIndex], ['pages/public_welfare/activity', pagesPublicWelfareActivity], ['pages/public_welfare/activity_detail', pagesPublicWelfareActivityDetail], ['pages/public_welfare/welfare', pagesPublicWelfareWelfare], ['pages/public_welfare/welfare_detail', pagesPublicWelfareWelfareDetail], ['pages/public_welfare/welfare_apply', pagesPublicWelfareWelfareApply], ['pages/public_welfare/welfare_success', pagesPublicWelfareWelfareSuccess], ['pages/public_welfare/welfare_record', pagesPublicWelfareWelfareRecord], ['pages/public_welfare/welfare_record_detail', pagesPublicWelfareWelfareRecordDetail], ['pages/user/index', pagesUserIndex], ['pages/user/my_profit', pagesUserMyProfit], ['pages/user/my_profit_list', pagesUserMyProfitList], ['pages/user/my_profit_cash_none', pagesUserMyProfitCashNone], ['pages/user/cash_now', pagesUserCashNow], ['pages/user/cash_success', pagesUserCashSuccess], ['pages/user/sign', pagesUserSign], ['pages/user/team', pagesUserTeam], ['pages/user/team_member', pagesUserTeamMember], ['pages/user/integral', pagesUserIntegral], ['pages/user/apply_log', pagesUserApplyLog], ['pages/user/upgrade', pagesUserUpgrade], ['pages/user/upgrade_pay_success', pagesUserUpgradePaySuccess], ['pages/user/buy_log', pagesUserBuyLog], ['pages/user/qrcode', pagesUserQrcode], ['pages/user/bank_card', pagesUserBankCard], ['pages/user/bank_card_add', pagesUserBankCardAdd], ['pages/user/address', pagesUserAddress], ['pages/user/address_add', pagesUserAddressAdd], ['pages/user/address_edit', pagesUserAddressEdit], ['pages/user/help', pagesUserHelp], ['pages/user/help_detail', pagesUserHelpDetail], ['pages/user/course', pagesUserCourse], ['pages/user/course_detail', pagesUserCourseDetail], ['pages/user/order', pagesUserOrder], ['pages/user/user_info_edit', pagesUserUserInfoEdit], ['pages/user/order_detail', pagesUserOrderDetail], ['pages/user/order_pay_success', pagesUserOrderPaySuccess], ['pages/user/setting', pagesUserSetting], ['pages/user/set_phone', pagesUserSetPhone], ['pages/user/set_password', pagesUserSetPassword], ['pages/user/set_password_phone', pagesUserSetPasswordPhone], ['pages/user/about', pagesUserAbout], ['pages/user/company_auth', pagesUserCompanyAuth], ['pages/user/collection', pagesUserCollection], ['pages/user/issue', pagesUserIssue], ['pages/user/company_address', pagesUserCompanyAddress], ['pages/business_school/index', pagesBusinessSchoolIndex], ['pages/business_school/course_list', pagesBusinessSchoolCourseList], ['pages/business_school/detail', pagesBusinessSchoolDetail], ['pages/business_school/build_company', pagesBusinessSchoolBuildCompany], ['pages/business_school/architect', pagesBusinessSchoolArchitect], ['pages/business_school/other', pagesBusinessSchoolOther], ['pages/tendering/index', pagesTenderingIndex], ['pages/all_services/index', pagesAllServicesIndex], ['pages/all_services/none', pagesAllServicesNone], ['pages/all_services/life', pagesAllServicesLife], ['pages/mall/index', pagesMallIndex], ['pages/mall/detail', pagesMallDetail], ['pages/mall/order_confirm', pagesMallOrderConfirm], ['pages/mall/pay_success', pagesMallPaySuccess], ['pages/mall/custom', pagesMallCustom], ['pages/mall/custom_list', pagesMallCustomList], ['pages/mall/custom_detail', pagesMallCustomDetail], ['pages/mall/order_confirm_custom', pagesMallOrderConfirmCustom], ['pages/mall/address', pagesMallAddress], ['pages/login/login', pagesLoginLogin], ['pages/login/register_step_one', pagesLoginRegisterStepOne], ['pages/login/register_step_two', pagesLoginRegisterStepTwo], ['pages/login/forget_password', pagesLoginForgetPassword], ['pages/login/qr_code', pagesLoginQrCode], ['pages/other/report_detail', pagesOtherReportDetail], ['pages/other/submit_success', pagesOtherSubmitSuccess], ['pages/other/report_success', pagesOtherReportSuccess], ['pages/other/regist_agreement', pagesOtherRegistAgreement], ['pages/newest/index', pagesNewestIndex], ['pages/newest/personnel_center', pagesNewestPersonnelCenter], ['pages/newest/demand_detail', pagesNewestDemandDetail], ['pages/newest/service_detail', pagesNewestServiceDetail], ['pages/newest/position_detail', pagesNewestPositionDetail], ['pages/newest/personnel_detail', pagesNewestPersonnelDetail]], Taro, App.config);
Taro.initNativeApi(Taro);
Taro.initPxTransform({
  "designWidth": 750,
  "deviceRatio": {
    "640": 1.17,
    "750": 1,
    "828": 0.905
  }
});
export default App;